package com.runen.infinitemovement.model.base;

/**
 * 响应码及信息
 */
public class BaseStatus {
    private int code;
    private String msg;
    private String status;
    private boolean success;
    // 200成功
    public static final int RESPONSE_CODE_SUCCESS = 0;
    //非法的用户会话信息
    public static final int RESPONSE_CODE_ERROR_INVALID_TOKEN = 10003;

    public int getCode() {
        return code;
    }

    public void setErrorCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public boolean isSuccess() {
        return status.equals("200") ? true : false;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }


    @Override
    public String toString() {
        return "BaseStatus{" +
                "errorCode=" + code +
                ", msg='" + msg + '\'' +
                ", status='" + status + '\'' +
                ", success=" + success +
                '}';
    }
}
